Windows Driver Model (WDM) is a general driver model for Windows drivers, which is introduced by Microsoft Corporation. It is a strategy for making driver development simpler. With system upgrades, WDM is more and more useful and popular for Windows driver development. WDM uses a layered approach in which a given device is served by at least two drivers: a bus driver and a function driver. A device might also have filter drivers that add value or modify the behavior of the device. Each of the drivers divides the I/O request into simpler requests to transfer them to lower-level drivers. After receiving the I/O request, the bus driver begins interacting with the hardware through the Hardware Abstraction Layer to respond to the I/O request. In general, the smart card manufacturer provides a function driver with the physical smart card device. The function driver then communicates with the upper-level applications, as reader's interface. And it can also communicate with the bus driver at lower-level to read from or write to the hardware device. Both of the functions can be implemented by a single function driver, or by two individual function drivers as required (hereinafter collectively “the smart card device function driver”). When sent by an application, the data is transmitted through the smart card service system, the smart card device function driver, and the bus driver to the physical smart card device. When returned by the hardware device, the data is transmitted through the bus driver, the smart card device function driver, and the smart card service system to the application.
When developing the smart card device function driver, it is necessary to give a PC/SC callback function interface in the driver and specify a reader name in the device function driver. Generally, the callback function is given a name by its user. The function body is defined by the system. The callback function is used as follows: the user defines a function variable type before defining a variable of this type, and assigns a value to the variable, then passes the variable as an argument to the caller (typically the system itself), and finally the caller calls the callback function using the argument.
The application layer can initiate normal smart card communication using the PC/SC interface of the smart card service thereby. By doing so, the smart card can implement all of the smart card applications. The PC/SC Specification is a Windows platforms based standard user interface (i.e. API) which is promoted by the PC/SC Working Group that is made up of people from Microsoft Corporation and some world renowned smart card manufacturers. The Specification provides an integrated environment from the personal computer to the smart card. Applications can communicate with the smart card through the standard user interface.
The Human Interface Device (HID) can be used once after it is connected to the Windows based systems. The user does not need to install any driver developed for the device. All human interface devices use the HID device class driver (hidclass.sys) came with the system to establish relationship with applications. The programs at the application layer can gain access to the human interface device simply by calling existing application layer interface (HID API). A physical human interface device can satisfy generic user needs without additional modification to the system for this reason.
However, the application has to call HID API to gain access to the physical human interface device, because the HID device class driver (hidclass.sys) does not provide functions for the reader part and the data cannot be transmitted through the smart card service system directly. Thus, a problem comes that only a physical human interface device itself cannot implement the functions of the smart card.